[BITS 32]
[SECTION .text]
EXTERN int_controller

%IMACRO	INT_A 1
[GLOBAL	isr%1]
ALIGN	4
isr%1:
	CLI
	PUSH	DWORD	0
	PUSH	DWORD	%1
	JMP	Handler
%ENDMACRO

%IMACRO INT_B 1
[GLOBAL	isr%1]
ALIGN	4
isr%1:
	CLI
	PUSH	DWORD	%1
	JMP	Handler
%ENDMACRO
	
[EXTERN	CHandler]
Handler:
	PUSHA
	
	PUSH	DS
	PUSH	ES
	PUSH	FS
	PUSH	GS
	
	MOV	EAX, 0x10
	MOV	DS, AX
	MOV	ES, AX
	MOV	FS, AX
	MOV	GS, AX
	
	PUSH	ESP
	CALL	CHandler
	POP	ESP
	
	POP	GS
	POP	FS
	POP	ES
	POP	DS
	
	POPA

	ADD	ESP, 8

	STI
	IRET
	
INT_A 0
INT_A 1
INT_A 2
INT_A 3
INT_A 4
INT_A 5
INT_A 6
INT_A 7
INT_B 8
INT_A 9
INT_B 10
INT_B 11
INT_B 12
INT_B 13
INT_B 14
INT_A 15
INT_A 16
INT_A 17
INT_A 18
INT_A 19
INT_A 20
INT_A 21
INT_A 22
INT_A 23
INT_A 24
INT_A 25
INT_A 26
INT_A 27
INT_A 28
INT_A 29
INT_A 30
INT_A 31
INT_A 32
INT_A 33
INT_A 34
INT_A 35
INT_A 36
INT_A 37
INT_A 38
INT_A 39
INT_A 40
INT_A 41
INT_A 42
INT_A 43
INT_A 44
INT_A 45
INT_A 46
INT_A 47
INT_A 48;
INT_A 49;
INT_A 50;
INT_A 51;
INT_A 52;
INT_A 53;
INT_A 54;
INT_A 55;
INT_A 56;
INT_A 57;
INT_A 58;
INT_A 59;
INT_A 60;
INT_A 61;
INT_A 62;
INT_A 63;
INT_A 64;
INT_A 65;
INT_A 66;
INT_A 67;
INT_A 68;
INT_A 69;
INT_A 70;
INT_A 71;
INT_A 72;
INT_A 73;
INT_A 74;
INT_A 75;
INT_A 76;
INT_A 77;
INT_A 78;
INT_A 79;
INT_A 80;
INT_A 81;
INT_A 82;
INT_A 83;
INT_A 84;
INT_A 85;
INT_A 86;
INT_A 87;
INT_A 88;
INT_A 89;
INT_A 90;
INT_A 91;
INT_A 92;
INT_A 93;
INT_A 94;
INT_A 95;
INT_A 96;
INT_A 97;
INT_A 98;
INT_A 99;
INT_A 100;
INT_A 101;
INT_A 102;
INT_A 103;
INT_A 104;
INT_A 105;
INT_A 106;
INT_A 107;
INT_A 108;
INT_A 109;
INT_A 110;
INT_A 111;
INT_A 112;
INT_A 113;
INT_A 114;
INT_A 115;
INT_A 116;
INT_A 117;
INT_A 118;
INT_A 119;
INT_A 120;
INT_A 121;
INT_A 122;
INT_A 123;
INT_A 124;
INT_A 125;
INT_A 126;
INT_A 127;
INT_A 128;
INT_A 129;
INT_A 130;
INT_A 131;
INT_A 132;
INT_A 133;
INT_A 134;
INT_A 135;
INT_A 136;
INT_A 137;
INT_A 138;
INT_A 139;
INT_A 140;
INT_A 141;
INT_A 142;
INT_A 143;
INT_A 144;
INT_A 145;
INT_A 146;
INT_A 147;
INT_A 148;
INT_A 149;
INT_A 150;
INT_A 151;
INT_A 152;
INT_A 153;
INT_A 154;
INT_A 155;
INT_A 156;
INT_A 157;
INT_A 158;
INT_A 159;
INT_A 160;
INT_A 161;
INT_A 162;
INT_A 163;
INT_A 164;
INT_A 165;
INT_A 166;
INT_A 167;
INT_A 168;
INT_A 169;
INT_A 170;
INT_A 171;
INT_A 172;
INT_A 173;
INT_A 174;
INT_A 175;
INT_A 176;
INT_A 177;
INT_A 178;
INT_A 179;
INT_A 180;
INT_A 181;
INT_A 182;
INT_A 183;
INT_A 184;
INT_A 185;
INT_A 186;
INT_A 187;
INT_A 188;
INT_A 189;
INT_A 190;
INT_A 191;
INT_A 192;
INT_A 193;
INT_A 194;
INT_A 195;
INT_A 196;
INT_A 197;
INT_A 198;
INT_A 199;
INT_A 200;
INT_A 201;
INT_A 202;
INT_A 203;
INT_A 204;
INT_A 205;
INT_A 206;
INT_A 207;
INT_A 208;
INT_A 209;
INT_A 210;
INT_A 211;
INT_A 212;
INT_A 213;
INT_A 214;
INT_A 215;
INT_A 216;
INT_A 217;
INT_A 218;
INT_A 219;
INT_A 220;
INT_A 221;
INT_A 222;
INT_A 223;
INT_A 224;
INT_A 225;
INT_A 226;
INT_A 227;
INT_A 228;
INT_A 229;
INT_A 230;
INT_A 231;
INT_A 232;
INT_A 233;
INT_A 234;
INT_A 235;
INT_A 236;
INT_A 237;
INT_A 238;
INT_A 239;
INT_A 240;
INT_A 241;
INT_A 242;
INT_A 243;
INT_A 244;
INT_A 245;
INT_A 246;
INT_A 247;
INT_A 248;
INT_A 249;
INT_A 250;
INT_A 251;
INT_A 252;
INT_A 253;
INT_A 254;
INT_A 255;

